<template>
  <div class="el_main_con">
    <Breadcrumb></Breadcrumb>
    <el-card>
      <el-table :data="rightsList" border>
        <el-table-column type="index"></el-table-column>
        <el-table-column prop="authName" label="权限名称">
        </el-table-column>
        <el-table-column prop="path" label="路径">
        </el-table-column>
        <el-table-column prop="level" label="权限等级">
          <template slot-scope="scope">
            <el-tag type="success" v-if="scope.row.level === '0'">标签一</el-tag>
            <el-tag v-else-if="scope.row.level === '1'">标签二</el-tag>
            <el-tag type="warning" v-else>标签三</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import Breadcrumb from 'components/breadcrumb/breadcrumb'
import { Authority } from '../../api/apiConfig'
export default {
  components: {
    Breadcrumb
  },
  data () {
    return {
      rightsList: []
    }
  },
  mounted () {
    this.getrightsList()
  },
  methods: {
    getrightsList () {
      const url = 'rights/list'
      Authority.getrightsList(url).then(res => {
        if (res.meta.status !== 200) return this.$message.error(res.meta.message)
        this.rightsList = res.data
      })
    }
  }
}
</script>

<style lang="less" scoped>
</style>
